package com.ncf.jucai.mybatis.generator;

import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.PluginAdapter;

import java.util.List;
import java.util.regex.Matcher;

/**
 * @author lichengwen
 * @since 2016/4/7 17:31
 */
public class EntityNameGeneratorPlugin extends PluginAdapter {

    public EntityNameGeneratorPlugin() {
        super();
    }

    @Override
    public boolean validate(List<String> warnings) {
        return true;
    }

    @Override
    public void initialized(IntrospectedTable introspectedTable) {
        String old = introspectedTable.getBaseRecordType();
        introspectedTable.setBaseRecordType(old + "Entity");
    }
}
